﻿@model GroupViewModel
@{
    ViewBag.Title = "Edit group \"" + Model.Group.GroupName + "\"";
}
<h2>@ViewBag.Title</h2>
<div class="proggy-form-div">
    @using (Html.BeginForm())
    {
        <p>
            <label>
                Members:</label><br />
            <span class="italic">@Html.ActionLink("Add new", "AddGroupMembers", new { id = Model.Group.GroupId })</span>
        </p>        
        <table class="proggy-datatable">
            <tbody>
                @foreach (var member in Model.Members)
                { 
                    <tr>
                        <td>@member.Name (@member.Username)
                        </td>
                        <td>
                            @Html.ActionLink("Remove", "RemoveGroupMember", new { id = member.GroupMemberId, groupId=Model.Group.GroupId })
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    }
    <div>
        <p><br />@Html.ActionLink("Back to groups", "Groups")</p>
    </div>
</div>
